import Vue from 'vue'
import App from './App'
import router from './router'

import './plugins/element.js'
import 'element-ui/lib/theme-chalk/index.css'

import './assets/fonts/iconfont.css'

import './assets/css/global.css'

import axios from 'axios'

import TreeToble from 'vue-table-with-tree-grid'

/*
* 配置接口请求根目录
* 挂载到原型
* */
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
//请求拦截器添加token
axios.interceptors.request.use(config => {
  //获取token 添加权限 (Authorization)
  config.headers.Authorization = window.sessionStorage.getItem('token')
  // console.log(config)
  return config

})
Vue.prototype.$http = axios

Vue.config.productionTip = false

Vue.component('tree-toble', TreeToble)
new Vue({
  el: '#app',
  router,
  components: {App},
  template: '<App/>'
})
